package org.shoukaiseki.supersaiyan.generator.config;

import org.shoukaiseki.supersaiyan.generator.domain.GenResourceConf;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component;

import java.util.ArrayList;
import java.util.List;

/**
 * 读取代码生成相关配置
 *
 * @author ruoyi
 */
@Component
@Configuration
@ConfigurationProperties(prefix = "gen")
//@PropertySource(value = { "classpath:generator.yml" })
public class BaseGenConfig
{

    /** 默认资源配置名称 **/
    private String resourceConfName;

    /** 作者 */
    private  String author;

    /** 生成包路径 */
    private  String packageName;

    /** 自动去除表前缀，默认是false */
    private  boolean autoRemovePre;

    /** 表前缀(类名不会包含表前缀) */
    private  String tablePrefix;

    //是否进行字段陀峰转换
    private  boolean columnCamelCaseConvert;

    //资源配置
    private List<GenResourceConf> resourceConfList=new ArrayList<>();

    public String getAuthor() {
        return author;
    }

    public BaseGenConfig setAuthor(String author) {
        this.author = author;
        return this;
    }

    public String getPackageName() {
        return packageName;
    }

    public BaseGenConfig setPackageName(String packageName) {
        this.packageName = packageName;
        return this;
    }

    public boolean isAutoRemovePre() {
        return autoRemovePre;
    }

    public BaseGenConfig setAutoRemovePre(boolean autoRemovePre) {
        this.autoRemovePre = autoRemovePre;
        return this;
    }

    public String getTablePrefix() {
        return tablePrefix;
    }

    public BaseGenConfig setTablePrefix(String tablePrefix) {
        this.tablePrefix = tablePrefix;
        return this;
    }

    public boolean isColumnCamelCaseConvert() {
        return columnCamelCaseConvert;
    }

    public BaseGenConfig setColumnCamelCaseConvert(boolean columnCamelCaseConvert) {
        this.columnCamelCaseConvert = columnCamelCaseConvert;
        return this;
    }

    public List<GenResourceConf> getResourceConfList() {
        return resourceConfList;
    }

    public BaseGenConfig setResourceConfList(List<GenResourceConf> resourceConfList) {
        this.resourceConfList = resourceConfList;
        return this;
    }

    public String getResourceConfName() {
        return resourceConfName;
    }

    public BaseGenConfig setResourceConfName(String resourceConfName) {
        this.resourceConfName = resourceConfName;
        return this;
    }
}
